package com.theredspace.attask.air.model {
	
	import com.theredspace.attask.air.utils.CompileData;
	
	import mx.rpc.soap.LoadEvent;
	import mx.rpc.soap.WebService;
	
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	public class WebserviceProxy extends Proxy {
		
		//proxy name
		public static const NAME:String = "webserviceProxy";
		
		private var ws:WebService;
		
		//-----------------------------------------------------------------
		public function WebserviceProxy(data:Object=null) {
			super(NAME, data);
		}
		//-----------------------------------------------------------------
		
		private function onWsLoad(lEvt:LoadEvent):void {
			trace("onWsLoad");
			ws.addEventListener(LoadEvent.LOAD, onWsLoad);
		}
		
		//-----------------------------------------------------------------
		public function testService():void {
			trace("testService");
			ws = new WebService();
			ws.wsdl = CompileData.WS_URL;
			ws.loadWSDL();
		}
	}
}